<template>
  <div class="page">
    <div class="page__top">
      <RouterView v-slot="{ Component }">
        <Transition
          mode="out-in"
          enter-active-class="animate__animated animate__rotateInDownLeft"
          leave-active-class="animate__animated animate__rotateOutDownLeft"
        >
          <component :is="Component" />
        </Transition>
      </RouterView>
    </div>
    <div class="page__footer">
      <van-tabbar :fixed="false" route>
        <van-tabbar-item replace to="/films" icon="home-o">电影</van-tabbar-item>
        <van-tabbar-item replace to="/cinemas" icon="search">影院</van-tabbar-item>
        <van-tabbar-item replace to="/center" icon="friends-o">我的</van-tabbar-item>
      </van-tabbar>
    </div>
  </div>
</template>

<script lang="ts" setup></script>

<style lang="scss" scoped>
.page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;

  &__top {
    flex: 1;
    overflow: hidden;
  }
}

.router-transition-enter-active {
  transition: all 0.3s ease;
}

.router-transition-leave-active {
  transition: all 0.5s ease;
}

.router-transition-enter-from,
.router-transition-leave-to {
  transform: translateY(20px);
  opacity: 0;
}
</style>
